<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\card\model;

class UserInfo extends \app\BaseModel
{
    protected $name = "longbing_card_user_info";
    public function createUser($data)
    {
        $data["create_time"] = time();
        $result = $this->save($data);
        return !empty($result);
    }
    public function updateUser($filter, $data)
    {
        $data["update_time"] = time();
        $result = $this->where($filter)->update($data);
        return !empty($result);
    }
    public function cardList()
    {
        $data = $this->where(["fans_id" => 1])->find();
        return $data;
    }
    public function getUserPhone($user_id, $uniacid = NULL)
    {
        $filter = ["fans_id" => $user_id];
        if(!empty($uniacid)) {
            $filter["uniacid"] = $uniacid;
        }
        $result = $this->where($filter)->field("phone,wechat")->find();
        if(!empty($result)) {
            $result = $result->toArray();
        }
        return $result;
    }
    public function getStaffMaxAutoCount($filter)
    {
        $filter["is_staff"] = 1;
        $filter["is_default"] = 1;
        $count = $this->where($filter)->min("auto_count");
        return $count;
    }
}

?>